<template>
  <div class="fixed-title-container">
    <div class="box">
      <div class="icon" v-if="isShow" @click="handleBack">
        <IconFont name="rect-left" size="12"></IconFont>
      </div>
      <div class="text" :style="{ marginLeft: isShow ? '15px' : '0' }">{{ Title }}</div>
    </div>
  </div>
</template>

<script setup>
import { ref, reactive, onMounted, toRefs } from "vue";
import { IconFont } from "@nutui/icons-vue-taro";
import Taro from "@tarojs/taro";
const props = defineProps({
  Title: String,
  isShow: {
    required: false,
    default: false,
  },
});
const { Title, isShow } = toRefs(props);
const handleBack=()=>{
  Taro.navigateBack({
    delta: 1,
  })
}
</script>

<style lang="scss">
.fixed-title-container {
  height: 120px;
  padding: 0 30px;
  line-height: 120px;
  background: linear-gradient(
    to right,
    #d8ecfe,
    #d2e8fe,
    #cce5fe,
    #cde5ff,
    #c6e2ff,
    #c2dfff,
    #c1dffe
  );
  left: 0;
  right: 0;
  top: 0;
  z-index: 9;
  position: fixed;

  .box {
    display: flex;
    // justify-content: space-between;
    align-items: center;
    .icon {
     height: 50px;
     line-height: 50px;
     text-align: center;
      width: 50px;
      border-radius: 50%;
      background-color:d8ecfe;
      border: 1px solid #ccc;
    }
    .text {
      font-size: 30px;
      color: #15181d;
      font-weight: 700;
    }
  }
}
</style>
